Skip to content

Conversation

thomaskwaring
Copy link
Contributor

This pull request extends the development of SKI combinatory logic — adding notions of evaluation and normal forms, and proving a version of Rice's theorem. The results and definitions are contained in the new file CombinatoryLogic/Evaluation.lean, which is based heavily on the following development by Bhavik Mehta.

Notes

The definitions and results of this PR allows us to define normal-order evaluation as a PFun, in the sense of Mathlib. The missing piece to make this useful is the so-called Standardisation theorem, saying that normal-order reduction will find a normal form, if there is one. The proof of Theorem T9 of Section C in A Mathematical Logic Without Variables (Rosser, 1935) should be amenable to formalization. This would be very interesting, as it ought to define a surjection from SKI terms to, for instance, partial recursive functions on the natural numbers, demonstrating that SKI terms are Turing-complete.

@fmontesi
Copy link
Collaborator

fmontesi commented Sep 8, 2025

There seem to be conflicts?

@thomaskwaring
Copy link
Contributor Author

oops my mistake! i've fixed the conflicts but it doesn't want to build remotely (it goes through on my computer) i think because of the linter warnings — i'll come back to this soon but it seems to want no space after the transition arrows (ie (P ⬝ Abs) ↠TT instead of (P ⬝ Abs) ↠ TT) which seems strange

@thomaskwaring thomaskwaring marked this pull request as draft September 8, 2025 10:01
@thomaskwaring thomaskwaring marked this pull request as ready for review September 8, 2025 18:56
@chenson2018
Copy link
Collaborator

it seems to want no space after the transition arrows (ie (P ⬝ Abs) ↠TT instead of (P ⬝ Abs) ↠ TT) which seems strange

Depending on how your terminal displays certain Unicode, what appears as roughly a single space after an arrow may actually be multiple spaces

@thomaskwaring
Copy link
Contributor Author

thomaskwaring commented Sep 9, 2025

Hmm I don't think that's it, it's definitely asking for no spaces. It's only complaining about hypotheses of the form "blank reduces to blank" (eg hxz : x ↠z), not for instance hxt : ∃ x : SKI, (P ⬝ x) ↠ TT, and not anywhere other than as hypotheses to a theorem. Anyway not a huge deal, just strange.

I expect it's because in the declaration
notation3 t:39 " ⭢" $sym:str t':39 => (ReductionSystem.Red $rs) t t'
there's no space after the arrow, was that for any reason?

@chenson2018
Copy link
Collaborator

I expect it's because in the declaration notation3 t:39 " ⭢" $sym:str t':39 => (ReductionSystem.Red $rs) t t' there's no space after the arrow, was that for any reason?

For this branch with a symbol after the arrow, I think this makes sense. I see though that for the notation without a symbol it is also like this, is that what is being linted for you? This should be changed, probably not noticed previously because we don't use it much.

@thomaskwaring
Copy link
Contributor Author

For this branch with a symbol after the arrow, I think this makes sense. I see though that for the notation without a symbol it is also like this, is that what is being linted for you? This should be changed, probably not noticed previously because we don't use it much.

Ahh yes you're absolutely right — I've changed it and replaced the spaces after the transitions now

@fmontesi
Copy link
Collaborator

fmontesi commented Oct 6, 2025

Hi @thomaskwaring,
I think this is cooked enough now and would like to merge it, but I still get some weird diffs from old commits. Could I ask you to do a rebase, perhaps?

m-ow and others added 12 commits October 6, 2025 13:36
* add tensor zero eqv

* add parr top eqv

* use notation for zero and top

* add parr and tensor scoped notation
* confluence

* non-terminal simps

* style

* use reduction_sys

* non-terminal simp

* remove redundant lemma

* update TODO

* style

* fix Trans instances

* use Trans instance for brevity

* add a reference

* para_lc_l and para_lc_r as

* naming conventions

* change confusing names

* aesop ruleset

* rm unused lemma

* ASCII arrows

* missed rule_sets

* use proof irrelevance

* style

* namespace rule set
* Switch to the standard type for relations.

* Missing changes
* Activate mathlib linters and fix some warnings.

* Add lint & suggest action
@thomaskwaring
Copy link
Contributor Author

Hi @thomaskwaring, I think this is cooked enough now and would like to merge it, but I still get some weird diffs from old commits. Could I ask you to do a rebase, perhaps?

Thanks! I'm doing that now — sorry for the noise I'm not much up on my git-yoga

@chenson2018
Copy link
Collaborator

I find it mildly remarkable that there isn't a merge conflict here. Because @Shreyas4991 consistently added the namespace at the very top and bottom of each file, it's able to be merged automatically.

@Shreyas4991
Copy link
Contributor

Shreyas4991 commented Oct 15, 2025

Some of my review comments might need discussion on Zulip and collective decisions. I recommend merging in the main branch into this branch, before merging this PR because namespace related issues for identifiers could still bite.

EDIT: I highly recommend an 'SKIorCombinatoryLogicnamespace under theCslib` namespace to enable scoping all notation here.

@chenson2018
Copy link
Collaborator

EDIT: I highly recommend an 'SKIorCombinatoryLogicnamespace under theCslib` namespace to enable scoping all notation here.

There is an SKI namespace already, right? But yes, a pass to scope notations would be good.

@thomaskwaring
Copy link
Contributor Author

There is an SKI namespace already, right?

Yes there is, but I was a bit inconsistent with it — fixed now & added the Cslib namespace to my branch

@thomaskwaring
Copy link
Contributor Author

gentle ping @fmontesi, I think I've addressed everything (correct me?) if you think this is merge-ready?

@fmontesi fmontesi merged commit d260cca into leanprover:main Oct 20, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.